home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / SICL / data1.cab / sicl32 / c / samples / misc / vxiiscpi.c < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-02  |  739 b   |  35 lines

  1. /* vxiiscpi.c
  2.    This example program measures AC voltage on a multimeter and 
  3.    prints out the results */
  4. #include <sicl.h>
  5. #include <stdio.h>
  6.  
  7. void main()
  8. {
  9.    INST dvm;
  10.    char strres[20];
  11.  
  12.    /* Print message and terminate on error */
  13.    ionerror (I_ERROR_EXIT);
  14.  
  15.    /* Open the multimeter session */
  16.    dvm = iopen ("iscpi,32");
  17.    itimeout (dvm, 10000);
  18.    
  19.    /* Initialize dvm */
  20.    iwrite (dvm, "*RST\n", 5, 1, NULL);
  21.  
  22.    /* Take measurement */
  23.    iwrite (dvm,"MEAS:VOLT:AC? 1, 0.001\n", 23, 1, NULL);
  24.   
  25.    /* Read measurements */
  26.    iread (dvm, strres, 20, NULL, NULL);
  27.  
  28.    /* Print the results */
  29.    printf("Result is %s\n", strres);
  30.  
  31.    /* Close the multimeter session */
  32.    iclose(dvm);
  33.  
  34. }
  35.